from werkzeug.security import generate_password_hash, check_password_hash

from .base import Base, db


class UserOrg(Base):

    __tablename__ = 'user_org'

    nick_name = db.Column(db.String(50), nullable=False)
    org_code = db.Column(db.String(10), nullable=False)

    def __init__(self, nick_name, org_code, create_user, update_user):
        super(UserOrg, self).__init__(create_user, update_user)
        self.org_code = org_code
        self.nick_name = nick_name

    def __repr__(self):
        desc = 'UserOrg:{'
        for key in self.__dict__:
            desc += '%s:%s\n' % (key, self.__dict__[key])
        return desc % '}'
